package com.aaa.dem1103.d04;

/**
 * @Author: whj
 * @Version 1.0
 * @Date: 2022/11/3  16:50
 */
public class Test {
    public static void main(String[] args) {
        Operator o=arr -> arr.length;
        fun(o);
    }
    public static void fun(Operator operator) {
        int sum[] = {11, 12, 13, 14,20};
        int sum1 = operator.getSum(sum);
        System.out.println("数组中元素的个数:" + sum1);
    }
}

interface Operator {
    //求数组中元素的和
    public int getSum(int[] arr);
}
